import service from '@/utils/request'
import qs from 'qs'

export const useProcess_stepsApi = (id: number) => {
	return service.get('/project/process-steps/' + id)
}

export const useProcess_stepsSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/project/process-steps', dataForm)
	} else {
		return service.post('/project/process-steps', dataForm)
	}
}

export const useStepDetail = (pageParams: { page: number; limit: number; projectId: number; stepId: number }) => {
	return service.get('/step_detail/page', {
		params: {
			page: pageParams.page,
			limit: pageParams.limit,
			projectId: pageParams.projectId,
			stepId: pageParams.stepId
		},
		paramsSerializer: params => {
			return qs.stringify(params)
		}
	})
}
